package pro.softzhang.algo.lc1500;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

public class LC1557_MinimumNumberOfVerticesToReachAllNodes {
    public static void main(String[] args) {

    }

    static class Solution {
        public List<Integer> findSmallestSetOfVertices(int n, List<List<Integer>> edges) {
            Set<Integer> id = new HashSet<>();
            for (List<Integer> edge : edges)
                id.add(edge.get(1));

            List<Integer> zid = new ArrayList<>();
            for (int i = 0; i < n; i++)
                if (!id.contains(i))
                    zid.add(i);
            return zid;
        }
    }
}
